<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>井石管理平台</title>

    <!-- Bootstrap core CSS -->
    <link href="__STATIC__/css/bootstrap.css" rel="stylesheet">

    <!-- Add custom CSS here -->
    <link href="__STATIC__/css/sb-admin.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/font-awesome/css/font-awesome.min.css">
</head>
<body>

<div id="wrapper">

    <!-- Sidebar -->
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="{:U('Ent/index')}">井石管理平台</a>

        </div>

        

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse navbar-ex1-collapse">

        <ul class="nav navbar-nav side-nav">
            <li class="dropdown">
                <a><i class="fa fa-reorder"></i> 数据管理</a>
                <if condition="$type eq 4">
                 <span id="disp"  style="color:#808080;display:none;">
                </if>
                <if condition="$type neq 4">
                 <span id="disp"  style="color:#808080;">
                </if>
                    <p style="cursor:pointer"><i class="new"></i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + <a href="{:U('Ent/index',array('list'=>'journalism'))}" <if condition="$type neq 4">style="color:#808080;"</if><if condition="$type eq 4">style="color:#FFFFFF;"</if> >新闻</a></p>";
                    <p style="cursor:pointer"><i class="new"></i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + <a href="{:U('Ent/index',array('list'=>'listimg'))}" <if condition="$type neq 1">style="color:#808080;"</if><if condition="$type eq 1">style="color:#FFFFFF;"</if>>图鉴</a></p>;
                    <p style="cursor:pointer"><i class="new"></i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + <a href="{:U('Ent/index',array('list'=>'newserver'))}" <if condition="$type neq 3">style="color:#808080;"</if><if condition="$type eq 3">style="color:#FFFFFF;"</if>>新服</a></p>;
                    <p style="cursor:pointer"><i class="new"></i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + <a href="{:U('Ent/index',array('list'=>'activity','listRows'=>'newactivity'))}" <if condition="$type neq 2">style="color:#808080;"</if><if condition="$type eq 2">style="color:#FFFFFF;"</if>>活动</a></p>;
                    <p style="cursor:pointer"><i class="new"></i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + <a href="{:U('Ent/index',array('list'=>'activity','listRows'=>'strategy'))}" <if condition="$type neq 5">style="color:#808080;"</if><if condition="$type eq 5">style="color:#FFFFFF;"</if>>攻略</a></p>;
                    <p style="cursor:pointer"><i class="new"></i> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; + <a href="{:U('Ent/index',array('list'=>'rotation'))}" <if condition="$type neq 6">style="color:#808080;"</if><if condition="$type eq 3">style="color:#FFFFFF;"</if>>轮播图</a></p>;
                </span>
            </li>
            <li class="dropdown">
                <a href="{:U('Ent/addAdmin')}"><i class="fa fa-edit"></i>添加管理</a>
            </li>
            <li class="dropdown">
                <a href="{:U('Ent/upd')}"><i class="fa fa-users"></i> 修改密码</a>  
             </li>
            

        </ul>

            <ul class="nav navbar-nav navbar-right navbar-user">

                <li class="dropdown user-dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-user"></i> 你好,{:session('username')} <b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        <li class="divider"></li>
                        <li><a href="{:U('login/logout')}"><i class="fa fa-power-off"></i> 退出</a></li>
                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </nav>


<div id="page-wrapper">
    
    <div class="row">
        <div class="col-md-6">
            <a href="" class=""></a>
        </div>
        <!-- <div class="col-md-6">
            <form action="{:U('Ent/index')}" method="post">
                <div class="form-group input-group">
                    <input type="text" class="form-control" name="key" placeholder="输入 设备ID或血糖值 搜索">
                    <span class="input-group-btn">
                      <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
                    </span>
                </div>
            </form>
        </div> -->
    </div>
     <table class="table table-hover table-striped" >
        <thead>
            <if condition="$type eq 3">
                 <tr>
                    <!--  新服-->
                    <th>编号</th>
                    <th>名称</th>
                    <th>创建时间</th>
                    <th>调整状态</th>
                    
                </tr>
            </if>
            <if condition="$type eq 6">
                 <tr>
                    <!--  新服-->
                    <th>编号</th>
                    <th>名称</th>
                    <th>图片</th>
                    <th>创建时间</th>
                    <th>调整状态</th>
                    
                </tr>
            </if>
            <if condition="$type eq 4">
                 <tr>
                    <!--  新闻-->
                    <th>编号</th>
                    <th>名称</th>
                    <th>创建时间</th>
                    <th>标题</th>
                    <th>详情内容</th>
                    <th>调整状态</th>
                </tr>
            </if>
            <if condition="$type eq 1">
                <tr>
                      <!--  图鉴-->
                    <th>编号</th>
                    <th>名称</th>
                    <th>创建时间</th>
                    <th>图片</th>
                    <th>详情图片</th>
                    <th>调整状态</th>
                </tr>
            </if>
            <if condition="$type eq 2 || $type eq 5">
                <tr>
                    <!--  最新活动 游戏攻略-->
                    <th>编号</th>
                    <th>名称</th>
                    <th>创建时间</th>
                    <th>简介标题</th>
                    <th>简介内容</th>
                    <th>图片</th> 
                    <th>详情标题</th>
                    <th>详情内容</th>
                    <th>调整状态</th>
                </tr>
            </if>
        </thead>
        <tbody>
        <foreach name="list" item="v">
            <if condition="$type eq 3">
                <tr>
                    <td>{$v.id}</td>
                    <td>{$v.newname}</td>
                    <td>{$v.createtime|default=time()|date='Y-m-d',###}</td>
                    <td><a href="{:U('Index/index',array('list'=>'server','register'=>$v['id']))}" style="text-decoration:none;color:#000000;cursor:pointer"  target="_blank">编辑</a> | <i onclick="delect(this,'server');" style="font-style: normal;cursor:pointer">删除</i></td>
                </tr>
            </if>
            <if condition="$type eq 6">
                <tr>
                    <td>{$v.id}</td>
                    <td>轮播图</td>
                    <td><img src="{$v.url_img}" alt="" style="width:40px"></td>
                    <td>{$v.createtime|default=time()|date='Y-m-d',###}</td>
                    <td><a href="{:U('Index/index',array('list'=>'rotation','register'=>$v['id']))}" style="text-decoration:none;color:#000000;cursor:pointer"  target="_blank">编辑</a> | <i onclick="delect(this,'rotation');" style="font-style: normal;cursor:pointer">删除</i></td>
                </tr>
            </if>
            <if condition="$type eq 4">
                <tr>
                    <td>{$v.id}</td>
                    <td><?php if($v['status']==1){echo "最新";}elseif($v['status']==2){echo "新闻";}else{
                        echo "公告";}?></td>
                    <td>{$v.createtime|default=time()|date='Y-m-d',###}</td>
                    <td>{$v.title}</td>
                    <td style="width:30em;"><?php echo substr(strip_tags($v['content']),0,60).'...';?></td>
                    <td><a href="{:U('Index/index',array('list'=>'jour','register'=>$v['id']))}" style="text-decoration:none;color:#000000;cursor:pointer"  target="_blank">编辑</a> | <i onclick="delect(this,'jour');" style="font-style: normal;cursor:pointer">删除</i></td>
                </tr>
            </if>
            <if condition="$type eq 1">
                <tr>
                    <td>{$v.id}</td>
                    <td><?php if($v['status']==1){echo "一星";}elseif($v['status']==2){echo "二星";}elseif($v['status']==3){
                        echo "三星";}else{echo "四星";}?></td>
                    <td>{$v.createtime|default=time()|date='Y-m-d',###}</td>
                    <td><img src="{$v.img}" alt="" style="width:40px"></td>
                    <td><img src="{$v.big_img}" alt="" style="width:40px"></td>
                    <td><a href="{:U('Index/index',array('list'=>'list','register'=>$v['id']))}" style="text-decoration:none;color:#000000;cursor:pointer"  target="_blank">编辑</a> | <i onclick="delect(this,'list');" style="font-style: normal;cursor:pointer">删除</i></td>
                </tr>
            </if>
            <if condition="$type eq 2 || $type eq 5">
                <tr>
                    <td>{$v.id}</td>
                    <td><?php if($v['status']==1){echo "最新活动";}?><?php if($v['status']==2){echo "游戏攻略";}?></td>
                    <td>{$v.createtime|default=time()|date='Y-m-d',###}</td>
                    <td>{$v.title}</td>
                    <td style="width:20em;"><?php echo substr(strip_tags($v['introduction']),0,100).'...';?></td>
                    <td><img src="{$v.img}" alt="" style="width:40px"></td>
                    <td>{$v.details_title}</td>
                    <td style="width:20em;"><?php echo substr(strip_tags($v['details_content']),0,100).'...';?></td>
                    <td><a href="{:U('Index/index',array('list'=>'ctivity','register'=>$v['id']))}" style="text-decoration:none;color:#000000;cursor:pointer"  target="_blank">编辑</a> | <i onclick="delect(this,'ctivity');"  style="font-style: normal;cursor:pointer">删除</i></td>
                </tr>
            </if>
            
        </foreach>
    </table>
   <div style="letter-spacing:6px;text-align:center"><b><h4>{$page}</h4></b></div>
</div>

<!-- JavaScript -->
<script src="__STATIC__/js/jquery-1.10.2.js"></script>
<script src="__STATIC__/js/bootstrap.js"></script>
<script src="__STATIC__/js/app.js"></script>
<script>
     $('.dropdown a').click(function(){
        $('#disp').toggle();
        $('#disp').css("color","#808080");
     })
     $('#disp p').click(function(){
        $('#disp p').css("color","#808080");
        $(this).css("color","#ffffff");
        $('.from-content .add').each(function(){
             $(this).hide();
        });

        var num = $(this).children('i').attr('name');
        if(num==1){
            $('#add1').show();
        }
         if(num==2){
            $('#add2').show();
        }
         if(num==3){
            $('#add3').show();
        }
         if(num==4){
             $('#add4').show();
             var ue = new UE.ui.Editor({} );
          var ueContact = new UE.ui.Editor({} );
          ue.render('editor');  
          ueContact.render('editorContact');   
        }
         if(num==5){
            $('#add3').show();
        }
        
     });
      function delect(obj,list){
        var register = $(obj).parent('td').parent('tr').children("td:first-child").html();
        var list = list;
       
        $.ajax({
            url: 'index.php?m=Admin&c=Ent&a=del',
            type: 'post',
            data: {
                'register':register,'list':list,
            },
            dataType:"JSON",
            success: function(data) {
                if(data.result==1){
                    $(obj).parent('td').parent('tr').remove();
                    alert(data.msg);  
                }
                if(data.result==0){
                    alert(data.msg);
                }
            }
        })
    }

 </script>
</body>
</html>
